package view;

import game.*;

import javax.swing.*;

/**
 * <p>Creates the current view of the chess game for the player to begin selecting the game.</p>
 * 
 * @author Nicole Waldrum
 * @date March 9, 2010
 * @version 3.0
 * 
 * @author Trevor Bastian
 * @date March 9, 2010
 * @version 3.0
 */
public class HelpGUI extends JFrame{

	private static final long serialVersionUID = 4894802705475258301L;
	
	JPanel panel;
	JLabel label;
	
	/**
	 * <p>Loads the help pages that are required by the gametype that the user has chosen.</p>
	 * 
	 * @param type is the {@code GameType} the user has chosen to play
	 */
	public HelpGUI(GameType type){
		panel = new JPanel();
		label = new JLabel();
		
		this.setResizable(false);
		
		if (type.getClass().equals(ClassicChess.class)){
			label.setIcon(new ImageIcon("Chess Rules.jpg"));
		}
		else if (type.getClass().equals(EightQueens.class)){
			label.setIcon(new ImageIcon("Eight Queens Rules.jpg"));
		}
		else if (type.getClass().equals(KnightTour.class)){
			label.setIcon(new ImageIcon("Knights Tour Rules.jpg"));
		}
		else{
			label.setIcon(new ImageIcon("No Game.jpg"));
		}
		panel.add(label);
		this.add(panel);
		this.pack();
		this.setVisible(true);
	}
	
}
